/*
 * EnigmaGM - A feature rich guild management system.
 * Copyright (C) 2007 ajiaojr.
 * 
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; either version 2
 * of the License, or (at your option) any later version.
 * 
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
 * 02110-1301, USA.
 */
package org.ajiaojr.enigmagm.client.service;

import com.google.gwt.user.client.rpc.AsyncCallback;

/**
 * Service for accessing character information from the underlying storage.
 * 
 * @author ajiaojr
 */
public interface CharacterServiceAsync {
  /**
   * @param eventID
   * @param firstResult
   * @param maxResults
   * @return
   * @throws DataAccessException
   */
  public void findAttendees(int eventID, int firstResult, int maxResults,
      AsyncCallback callback);

  /**
   * Finds the character according to the character's unique identifier.
   * 
   * @param characterID
   *          The unique identifier of the character.
   * @return
   * @throws DataAccessException
   */
  public void findByCharacterID(int characterID, AsyncCallback callback);

  /**
   * @param username
   * @param firstResult
   * @param maxResults
   * @return
   * @throws DataAccessException
   */
  public void findByUser(String username, int firstResult, int maxResults,
      AsyncCallback callback);

  /**
   * Lists all characters, sorts the characters according to the sort attribute
   * given.
   * 
   * @param sortAttribute
   *          attribute according to which characters are sorted.
   * @param ascending
   *          whether to sort the result in ascending order
   * @param firstResult
   *          index of the first result.
   * @param maxResults
   *          maximum number of results.
   * @return list of all characters.
   * @throws DataAccessException
   *           if error should occur during data access.
   */
  public void list(String sortAttribute, boolean ascending, int firstResult,
      int maxResults, AsyncCallback callback);
}
